package com.szewec.ps.ui.road.facilities.intersection.task.enums;

import com.szewec.ps.base.Enums;

import java.util.List;

public class RoadEnums {
    public enum JunctionType implements Enums.IKeyValueEnum {
        T_Y_INTERSECTION(1, "T型/Y型交叉口"),
        CROSSROADS(2, "十字型/X型交叉口"),
        MULTI_WAY_INTERSECTION(3, "多路交叉口"),
        ROUNDABOUT(4, "环形交叉口"),
        INTERCHANGE(5, "立体交叉口"),
        ;
        private final Integer key;
        private final String value;

        JunctionType(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            if (key == null) {
                return "";
            }
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.JunctionType.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.JunctionType.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.JunctionType.class);
        }
    }

    public enum CoordinateType implements Enums.IKeyValueEnum {
        IS_COORDINATE_TYPE(1, "信控交叉口"),
        NOT_COORDINATE_TYPE(2, "非信控交叉口");
        private final Integer key;
        private final String value;

        CoordinateType(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            if (key == null) {
                return "";
            }
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.CoordinateType.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.CoordinateType.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.CoordinateType.class);
        }
    }

    public enum DextroversionCanalization implements Enums.IKeyValueEnum {
        NOTHING(1, "无"),
        SCRIBING_ISLAND_SEPARATE_EXIT(2, "划线岛（单独出口道）"),
        SCRIBING_ISLAND_NO_SEPARATE_EXIT(3, "划线岛（无单独出口道）"),
        SOLID_ISLAND_SEPARATE_EXIT(4, "固体岛（单独出口道）"),
        SOLID_ISLAND_NO_SEPARATE_EXIT(5, "固体岛（无单独出口道）");
        private final Integer key;
        private final String value;

        DextroversionCanalization(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.DextroversionCanalization.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.DextroversionCanalization.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.DextroversionCanalization.class);
        }
    }

    /**
     * 中央分隔带
     */
    public enum CenterDivider implements Enums.IKeyValueEnum {
        DOUBLE_YELLOW_LINE(1, "双黄线"),
        SINGLE_YELLOW_LINE(2, "单黄线"),
        GUARDRAIL(3, "护栏"),
        FISH_MAW_LINE(4, "鱼肚线"),
        YELLOW_SLASH(5, "黄斜线"),
        GREEN_BELT(6, "绿化带");

        private final Integer key;
        private final String value;

        CenterDivider(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.CenterDivider.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.CenterDivider.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.CenterDivider.class);
        }
    }

    /**
     * 路侧分隔带
     */
    public enum RoadsideDivider implements Enums.IKeyValueEnum {
        WHITE_SOLID_LINE(1, "白实线"),
        GUARDRAIL(2, "护栏"),
        GREEN_BELT(3, "绿化带");

        private final Integer key;
        private final String value;

        RoadsideDivider(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.RoadsideDivider.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.RoadsideDivider.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.RoadsideDivider.class);
        }
    }

    public enum TrafficOrganizationType implements Enums.IKeyValueEnum {
        COMPLETE_SEPARATION(1, "完全分离"),
        PARTIAL_INTERCHANGE(2, "部分互通"),
        COMPLETE_INTERCHANGE(3, "完全互通");

        private final Integer key;
        private final String value;

        TrafficOrganizationType(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.TrafficOrganizationType.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.TrafficOrganizationType.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.TrafficOrganizationType.class);
        }
    }

    public enum TrafficGeometry implements Enums.IKeyValueEnum {
        SEPARATE_TYPE(1, "分离型"),
        HORN_TYPE(2, "喇叭型"),
        ALFALFA_LEAF_TYPE(3, "苜蓿叶型"),
        RHOMBUS(4, "菱型"),
        RING_TYPE(5, "环型"),
        TURBINE_TYPE(6, "涡轮型"),
        T_TYPE(7, "T型"),
        Y_TYPE(8, "Y型"),
        LEAF_TYPE(9, "叶型"),
        MIXED_TYPE(10, "混合型"),
        ORIENTED_TYPE(11, "定向型");

        private final Integer key;
        private final String value;

        TrafficGeometry(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.TrafficGeometry.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.TrafficGeometry.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.TrafficGeometry.class);
        }
    }

    public enum CentralIslandShape implements Enums.IKeyValueEnum {
        CIRCULAR(1, "圆形"),
        ROUND_DIAMOND(2, "圆角菱形"),
        ELLIPSE(3, "椭圆形");

        private final Integer key;
        private final String value;

        CentralIslandShape(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.CentralIslandShape.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.CentralIslandShape.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.CentralIslandShape.class);
        }
    }

    /**
     * 道路方向
     */
    public enum LaneDirection implements Enums.IKeyValueEnum {
        LEFT_TURN(1, "左转"),
        STRAIGHT_LEFT(2, "直左"),
        STRAIGHT(3, "直行"),
        STRAIGHT_RIGHT(4, "直右"),
        RIGHT_TURN(5, "右转");

        private final Integer key;
        private final String value;

        LaneDirection(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.LaneDirection.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.LaneDirection.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.LaneDirection.class);
        }
    }

    /**
     * 道路方向
     */
    public enum WidenDirection implements Enums.IKeyValueEnum {
        LEFT_TURN(1, "向左"),
        STRAIGHT(2, "直行"),
        RIGHT_TURN(3, "向右"),
        ;

        private final Integer key;
        private final String value;

        WidenDirection(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.WidenDirection.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.WidenDirection.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.WidenDirection.class);
        }
    }

    public enum TurnAround implements Enums.IKeyValueEnum {
        NO_TURNAROUND(1, "否"),
        INTERSECTION_TURNAROUND(2, "交叉口掉头"),
        ROAD_SECTION_TURNAROUND(3, "路段掉头");

        private final Integer key;
        private final String value;

        TurnAround(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.TurnAround.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.TurnAround.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.TurnAround.class);
        }
    }

    /**
     * 慢行道人-非分隔形式
     */
    public enum SlowLaneDivideType implements Enums.IKeyValueEnum {
        MIXED_ROAD(1, "混行"),
        GRATICULE_DIVIDE(2, "标线分隔"),
        PHYSICAL_DIVIDE(3, "物理分隔");

        private final Integer key;
        private final String value;

        SlowLaneDivideType(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.SlowLaneDivideType.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.SlowLaneDivideType.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.SlowLaneDivideType.class);
        }
    }

    /**
     * 慢行道-人行道铺面类型
     */
    public enum PaveType implements Enums.IKeyValueEnum {
        PERMEABLE_BRICK(1, "透水砖"),
        COLORED_ASPHALT(2, "彩色沥青"),
        PERMEABLE_CONCRETE(3, "透水混泥土"),
        GRANITE(4, "花岗岩"),
        GREEN_SLATE(5, "青石板"),
        OTHER(6, "其他"),
        ;

        private final Integer key;
        private final String value;

        PaveType(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.PaveType.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.PaveType.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.PaveType.class);
        }
    }

    /**
     * 闸道-闸道互通设置
     */
    public enum GatewayInterlow implements Enums.IKeyValueEnum {
        FULLY_INTERFLOW(1, "全互通"),
        SEMI_INTERFLOW(2, "半互通"),
        //当选择分离式时，起点终点垂直位置设置为不可选（直接隐藏吧）
        SEPARATING(3, "分离式"),
        ;

        private final Integer key;
        private final String value;

        GatewayInterlow(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) Enums.KeyValueEnumUtil.getValueByKey(RoadEnums.GatewayInterlow.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) Enums.KeyValueEnumUtil.getKeyByValue(RoadEnums.GatewayInterlow.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return Enums.KeyValueEnumUtil.getEnumValueList(RoadEnums.GatewayInterlow.class);
        }
    }
}
